package servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.alibaba.fastjson.JSON;

import dao.OrderMasterDao;
import dao.impl.OrderMasterDaoImpl;
import entity.Order_Master;
import entity.User;
import util.PayUtil;

public class SuccessDealServlet extends HttpServlet {
	private OrderMasterDao omd = new OrderMasterDaoImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession();
		PayUtil payUtil = (PayUtil)session.getAttribute("pay");
		User user = (User)session.getAttribute("user");
		//Order_Master om = new Order_Master(payUtil.getOrder_sn(), user.getUserId(), user.getUsername(), , "支付宝", order_money, shipping_money, payment_money, shipping_comp_name, shipping_sn, create_time, shipping_time, pay_time, receive_time, order_status, order_point, modified_time);
		response.getWriter().print(JSON.toJSONString(payUtil));
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
